home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINPROGS / WINSRC20.ZIP / FRACTINT.H < prev    next >
Text File  |  1990-09-13  |  16KB  |  494 lines

  1.  
  2. /* FRACTINT.H - common structures and values for the FRACTINT routines */
  3.  
  4. #define MAXPIXELS 2049        /* Maximum pixel count across/down the screen */
  5. #define SCREENASPECT 0.75    /* Assumed overall screen dimensions, y/x     */
  6.  
  7. struct videoinfo {        /* All we need to know about a Video Adapter */
  8.     char    name[26];    /* Adapter name (IBM EGA, etc)        */
  9.     char    comment[26];    /* Comments (UNTESTED, etc)        */
  10.     int    videomodeax;    /* begin with INT 10H, AX=(this)    */
  11.     int    videomodebx;    /*        ...and BX=(this)    */
  12.     int    videomodecx;    /*        ...and CX=(this)    */
  13.     int    videomodedx;    /*        ...and DX=(this)    */
  14.                 /* NOTE:  IF AX==BX==CX==0, SEE BELOW    */
  15.     int    dotmode;    /* video access method used by asm code */
  16.                 /*    1 == BIOS 10H, AH=12,13 (SLOW)    */
  17.                 /*    2 == access like EGA/VGA    */
  18.                 /*    3 == access like MCGA        */
  19.                 /*    4 == Tseng-like  SuperVGA*256    */
  20.                 /*    5 == P'dise-like SuperVGA*256   */
  21.                 /*    6 == Vega-like     SuperVGA*256    */
  22.                 /*    7 == "Tweaked" IBM-VGA ...*256  */
  23.                 /*    8 == "Tweaked" SuperVGA ...*256 */
  24.                 /*    9 == Targa Format        */
  25.                 /*    10 = Hercules            */
  26.                 /*    11 = "disk video" (no screen)   */
  27.                 /*    12 = 8514/A            */
  28.                 /*    13 = CGA 320x200x4, 640x200x2    */
  29.                 /*    14 = Tandy 1000         */
  30.                 /*    15 = TRIDENT  SuperVGA*256    */
  31.                 /*    16 = Chips&Tech SuperVGA*256    */
  32.     int    xdots;        /* number of dots across the screen    */
  33.     int    ydots;        /* number of dots down the screen    */
  34.     int    colors;     /* number of colors available        */
  35.     };
  36.  
  37. /* NOTE:  if videomode[abc]x == 0, 'setvideomode' assumes it has an IBM (or
  38.     register compatible) adapter and tweaks the registers directly
  39.     to get one of the following modes (based on the value of videomodedx):
  40.  
  41.         1        704 x 528 x 16
  42.         2        720 x 540 x 16
  43.         3        736 x 552 x 16
  44.         4        752 x 564 x 16
  45.         5        768 x 576 x 16
  46.         6        784 x 588 x 16
  47.         7        800 x 600 x 16
  48.         8        360 x 480 x 16
  49.  
  50. */
  51.  
  52. #define INFO_ID     "Fractal"
  53. #define FRACTAL_INFO   struct fractal_info
  54.  
  55. struct fractal_info            /*  for saving data in GIF file     */
  56. {
  57.     char info_id[8];        /* Unique identifier for info block */
  58.     int iterations;
  59.     int fractal_type;        /* 0=Mandelbrot 1=Julia 2= ... */
  60.     double    xmin;
  61.     double    xmax;
  62.     double    ymin;
  63.     double    ymax;
  64.     double    creal;
  65.     double    cimag;
  66.     int    videomodeax;
  67.     int    videomodebx;
  68.     int    videomodecx;
  69.     int    videomodedx;
  70.     int    dotmode;
  71.     int    xdots;
  72.     int    ydots;
  73.     int colors;
  74.     int version;        /* used to be 'future[0]' */
  75.     float parm3;
  76.     float parm4;
  77.     float potential[3];
  78.     int rseed;
  79.     int rflag;
  80.     int biomorph;
  81.     int inside;
  82.     int logmap;
  83.     float invert[3];
  84.     int decomp[2];
  85.     int symmetry;
  86.     /* version 2 stuff */
  87.     int init3d[16];
  88.     int previewfactor;
  89.     int xtrans;
  90.     int ytrans;
  91.     int red_crop_left;
  92.     int red_crop_right;
  93.     int blue_crop_left;
  94.     int blue_crop_right;
  95.     int red_bright;
  96.     int blue_bright;
  97.     int xadjust;
  98.     int eyeseparation;
  99.     int glassestype;
  100.     /* version 3 stuff, release 13 */
  101.     int outside;
  102.     /* version 4 stuff, release 14 */
  103.     double x3rd;      /* 3rd corner */
  104.     double y3rd;
  105.     char stdcalcmode;      /* 1/2/g/b */
  106.     char useinitorbit;      /* init Mandelbrot orbit flag */
  107.     int calc_status;      /* resumable, finished, etc */
  108.     long tot_extend_len;  /* total length of extension blocks in .fra file */
  109.     int distest;
  110.     int floatflag;
  111.     int bailout;
  112.     long calctime;
  113.     unsigned char trigndx[4]; /* which trig functions selected */
  114.     int finattract;
  115.     double initorbit[2];  /* init Mandelbrot orbit values */
  116.     int periodicity;      /* periodicity checking */
  117.     /* version 5 stuff, release 15 */
  118.     int pot16bit;      /* save 16 bit continuous potential info */
  119.     float faspectratio;   /* finalaspectratio, y/x */
  120.     int system;       /* 0 for dos, 1 for windows */
  121.     int release;      /* release number, with 2 decimals implied */
  122.     int future[22];      /* for stuff we haven't thought of yet */
  123. };
  124.  
  125. #define MAXVIDEOMODES 100    /* maximum size of the video table */
  126.  
  127. #if defined(PUTTHEMHERE)    /* this MUST be defined ONLY in FRACTINT.C */
  128.  
  129. struct videoinfo videoentry;
  130.  
  131. int    maxvideomode;        /* size of the above list */
  132.  
  133. char *fkeys[] = {        /* Function Key names for display table */
  134.     /* "F1", Appropriated by the Help function */
  135.     "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10",
  136.     "SF1","SF2","SF3","SF4","SF5","SF6","SF7","SF8","SF9","SF10",
  137.     "CF1","CF2","CF3","CF4","CF5","CF6","CF7","CF8","CF9","CF10",
  138.     "AF1","AF2","AF3","AF4","AF5","AF6","AF7","AF8","AF9","AF10",
  139.     "Alt-1","Alt-2","Alt-3","Alt-4","Alt-5",
  140.     "Alt-6","Alt-7","Alt-8","Alt-9","Alt-0",
  141.     "Alt-Q","Alt-W","Alt-E","Alt-R","Alt-T",
  142.     "Alt-Y","Alt-U","Alt-I","Alt-O","Alt-P",
  143.     "Alt-A","Alt-S","Alt-D","Alt-F","Alt-G",
  144.     "Alt-H","Alt-J","Alt-K","Alt-L",
  145.     "Alt-Z","Alt-X","Alt-C","Alt-V","Alt-B","Alt-N","Alt-M",
  146.     "Alt--","Alt-=",
  147.     "Ctl-A","Ctl-B",        "Ctl-D","Ctl-E","Ctl-F","Ctl-G",
  148.     "Ctl-K","Ctl-L","Ctl-N","Ctl-O","Ctl-P",        "Ctl-R",
  149.         "Ctl-T","Ctl-U","Ctl-V","Ctl-W","Ctl-X","Ctl-Y","Ctl-Z",
  150.     "F11","F12","SF11","SF12","CF11","CF12","AF11","AF12",
  151.     "Alt-,","Alt-.","Alt-/","Alt-;","Alt-'","Alt-[","Alt-]","Alt-\\",
  152.     "Alt-`","A-Tab","A-Bks","A-Esc",
  153.     "END"};
  154.  
  155. int kbdkeys[] = {        /* Function Keystrokes for above names */
  156.     /* 1059,  Appropriated by the Help function */
  157.     1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068,
  158.     1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093,
  159.     1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103,
  160.     1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113,
  161.     1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129,
  162.     1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025,
  163.     1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038,
  164.     1044, 1045, 1046, 1047, 1048, 1049, 1050,
  165.     1130, 1131,
  166.        1,     2,         4,    5,     6,    7,
  167.       11,    12,   14,   15,   16,        18,
  168.         20,   21,   22,   23,    24,   25,   26,
  169.     1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140,
  170.     1051, 1052, 1053, 1039, 1040, 1026, 1027, 1043,
  171.     1041, 1165, 1014, 1001,
  172.     0};
  173.  
  174. #else
  175.  
  176. extern struct videoinfo videoentry;
  177. extern int maxvideomode;
  178.  
  179. #endif
  180.  
  181. #define NUMIFS      32     /* number of ifs functions in ifs array */
  182. #define IFSPARM    7     /* number of ifs parameters */
  183. #define IFS3DPARM 13     /* number of ifs 3D parameters */
  184.  
  185. /* defines for symmetry */
  186. #define  NOSYM        0
  187. #define  XAXIS_NOPARM  -1
  188. #define  XAXIS        1
  189. #define  YAXIS_NOPARM  -2
  190. #define  YAXIS        2
  191. #define  XYAXIS_NOPARM -3
  192. #define  XYAXIS     3
  193. #define  ORIGIN_NOPARM -4
  194. #define  ORIGIN     4
  195. #define  PI_SYM_NOPARM -5
  196. #define  PI_SYM     5
  197. #define  XAXIS_NOIMAG  -6
  198. #define  XAXIS_NOREAL    6
  199. #define  NOPLOT        99
  200. #define  SETUP_SYM    100
  201.  
  202. /* bitmask defines for fractalspecific flags */
  203. #define  NOZOOM     1    /* zoombox not allowed at all       */
  204. #define  NOGUESS    2    /* solid guessing not allowed       */
  205. #define  NOTRACE    4    /* boundary tracing not allowed       */
  206. #define  NOROTATE    8    /* zoombox rotate/stretch not allowed */
  207. #define  NORESUME      16    /* can't interrupt and resume         */
  208. #define  INFCALC       32    /* this type calculates forever       */
  209. #define  TRIG1           64    /* number of trig functions in formula*/
  210. #define  TRIG2          128
  211. #define  TRIG3          192
  212. #define  TRIG4          256
  213. #define  WINFRAC      512    /* supported in WinFrac           */
  214.  
  215. #define AUTOINVERT -123456.789
  216. extern float   far initifs[NUMIFS][IFSPARM];          /* IFS code values */
  217. extern float   far initifs3d[NUMIFS][IFS3DPARM];      /* IFS 3D code values */
  218.  
  219. #define N_ATTR 8            /* max number of attractors    */
  220.  
  221. struct fractalspecificstuff
  222. {
  223.    char  *name;             /* name of the fractal */
  224.    char  *param[4];            /* name of the parameters */
  225.    float paramvalue[4];     /* default parameter value */
  226.    int     flags;             /* constraints, bits defined above */
  227.    float xmin;                /* default XMIN corner */
  228.    float xmax;                /* default XMAX corner */
  229.    float ymin;                /* default YMIN corner */
  230.    float ymax;                /* default YMAX corner */
  231.    int     isinteger;            /* 1 if integerfractal, 0 otherwise */
  232.    int     tojulia;            /* mandel-to-julia switch */
  233.    int     tomandel;            /* julia-to-mandel switch */
  234.    int     tofloat;            /* integer-to-floating switch */
  235.    in